package com.aaa.dao.impl;

import com.aaa.dao.ResourceDao;
import com.aaa.util.BaseDao;

public class ResourceDaoImpl implements ResourceDao {
    private BaseDao baseDao = BaseDao.getInstance();

    @Override
    public int deleteResourceByResourceId(Integer resourceId) {
        String sql = "delete from resource_role where resource_id = ?";
        Object[] params = {resourceId};
        return baseDao.executeUpdate(sql,params);
    }

    @Override
    public int addResourceAndRole(Integer roleId, Integer resourceId) {
        String sql = "insert into resource_role (role_id,resource_id) values(?,?)";
        Object[] params = {roleId,resourceId};
        return baseDao.executeUpdate(sql,params) ;
    }

}
